<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>
<body>
	<div id="app"></div>
</body>
<script>
	const vnode = {
		type: 'div',
		props: {
			class: 'test',
		},
		children: 'hello world',
	};
	// 创建一个redner函数
	function render(vnode, container) {
		// 创建一个元素
		const el = document.createElement(vnode.type);
		// 设置属性
		for (const key in vnode.props) {
			el.setAttribute(key, vnode.props[key]);
		}
		// 设置文本内容
		el.textContent = vnode.children;
		// 挂载到容器上
		container.appendChild(el);
	}
	const container = document.getElementById('app');
	// 渲染vnode
	render(vnode, container);
</script>
</html>